﻿/*

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.OleDb;
using System.Data.Sql;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for Dangnhap
/// </summary>
public class Login
{
    public XL_TK TAI_KHOAN; 

    //protected int MTK; // Ma Tai khoan
    //protected int MLTK; // Ma Loai Tai Khoan
    //protected String Mathe; // Ma The
    //protected String USN; // Ten
    //protected String PAW; // Matkhau
    //public String Ten
    //{
    //    get
    //    {
    //        return this.USN;
            
    //    }
    //    set
    //    {
    //        this.USN = value;
    //    }
    //}

    //public String Matkhau
    //{
    //    get
    //    {
    //        return this.PAW;
    //    }
    //    set
    //    {
    //        this.PAW = value;
    //    }
    //}
    //public String Ma_the
    //{
    //    get
    //    {
    //        return this.Mathe;

    //    }
    //    set
    //    {
    //        this.Mathe = value;
    //    }
    //}
    public Login()
    {
    //TAI_KHOAN = new XL_TK();
    }

    public Login(String Ten, String Matkhau)
	{
        
		// TODO: Add constructor logic here
		//
        // Tao chuoi SQL
        String Chuoi_sql = "select * from TAI_KHOAN ";
        Chuoi_sql += "where Ten_TK='XXX' and Matkhau_TK='YYY'";
        //Chuoi_sql += "select Ten_TK,Matkhau_TK,Mathe from TAI_KHOAN tk "
                    
        Chuoi_sql=Chuoi_sql.Replace("XXX", Ten);
        Chuoi_sql = Chuoi_sql.Replace("YYY", Matkhau);
                
        DataTable Bang = DataProvider.ExecuteQuery(Chuoi_sql);
        if (Bang.Rows.Count > 0)
        {
            DataRow Dong = Bang.Rows[0];

            this.TAI_KHOAN = new XL_TK(Dong);
            //this.TAI_KHOAN.Ten_TK = Dong["Ten_TK"].ToString();
            //this.TAI_KHOAN.Matkhau_TK = Dong["Matkhau_TK"].ToString();
            //this.TAI_KHOAN.Hoten = Dong["Hoten"].ToString();
            //this.TAI_KHOAN.Mathe = Dong["Mathe"].ToString();
            //this.TAI_KHOAN.Diachi = Dong["Diachi"].ToString();
            //this.TAI_KHOAN.MLTK = int.Parse(Dong["MLTK"].ToString());
            //this.TAI_KHOAN.MTK = int.Parse(Dong["MTK"].ToString());
            //this.TAI_KHOAN.Ngaysinh = (DateTime)Dong["Ngaysinh"];
            //this.TAI_KHOAN.Tinhtrang_TK = (bool)Dong["Tinhtrang_TK"];

            //this.Matkhau = Dong["Matkhau_TK"].ToString();
            //this.Mathe = Dong["Mathe"].ToString();

        }
	}
}

*/